package com.suse.warmstill.service.repository;

import com.suse.warmstill.common.enums.RedisEnum;
import com.suse.warmstill.common.utils.RedisCache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author 黄靖
 * @author 2022-10-20 00:05
 * description:
 **/
@Component
public class TokenRepository {
    @Autowired
    private RedisCache redisCache;

    public int getAccessToken(String token) {
        String key = RedisEnum.LOGIN_TOKEN + token;
        return redisCache.getCacheObject(key);
    }
}
